package com.macro.mall.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.macro.mall.mapper.CmsPrefrenceAreaMapper;
import com.macro.mall.domain.CmsPrefrenceArea;
import com.macro.mall.service.CmsPrefrenceAreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 商品优选管理Service实现类
 * Created by macro on 2018/6/1.
 */
@Service
public class CmsPrefrenceAreaServiceImpl extends ServiceImpl<CmsPrefrenceAreaMapper, CmsPrefrenceArea> implements CmsPrefrenceAreaService {

    @Override
    public List<CmsPrefrenceArea> listAll() {
        /*
        LambdaQueryWrapper<CmsPrefrenceArea> wapper = new LambdaQueryWrapper<CmsPrefrenceArea>()
                .select(CmsPrefrenceArea::getId, CmsPrefrenceArea::getName, CmsPrefrenceArea::getSubTitle, CmsPrefrenceArea::getSort, CmsPrefrenceArea::getShowStatus);
        List<CmsPrefrenceArea> result = prefrenceAreaMapper.selectList(wapper);
         */
        List<CmsPrefrenceArea> result = lambdaQuery()
                .select(CmsPrefrenceArea::getId, CmsPrefrenceArea::getName, CmsPrefrenceArea::getSubTitle, CmsPrefrenceArea::getSort, CmsPrefrenceArea::getShowStatus).list();
        return result;
    }
}
